{% extends 'layout.html' %}}

{% block main %}
    <ol class="breadcrumb">
        <li><a href="/admin">管理首页</a></li>
        <li><span>内容管理</span></li>
    </ol>
<table data-toggle="table"
       data-method="get"
       data-pagination="true"
       data-side-pagination="server"
       data-page-size="10"
       data-url="/api/admin/getAllContentInfo">
    <thead>
    <tr>
        <th data-field="_id">id</th>
        <th data-field="title">标题</th>
        <th data-field="category.name">分类</th>
        <th data-field="description">简介</th>
        <th data-field="date">创建时间</th>
        <th data-field="username">创建用户</th>
        <th data-field="view">阅读量</th>
        <th data-formatter="operate">操作</th>
    </tr>
    </thead>
</table>
<script type="application/javascript">
    function operate(v,r,i) {
        return '<a href="/admin/content/edit?id='+r._id+'">编辑</a> | <a href="/admin/content/delete?id='+r._id+'">删除</a>'
    }
</script>
{% endblock%}